package com.xyoto.community.controller;

import com.xyoto.community.dto.AddAnonymousUserDTO;
import com.xyoto.community.service.AnonyUserService;
import com.xyoto.community.service.PictureService;
import com.xyoto.community.service.TopicHotDynamicCacheService;
import com.xyoto.community.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName:   匿名昵称、头像信息Web接口
 * Author:      挽风
 * Date:        2020
 * Copyright:   2020 by 挽风1.0版本
 * Description:
 **/

@RestController
@RequestMapping("/anonymous")
@Api(value = "AnonymousnessController", tags = "匿名信息接口")
public class AnonymousnessController {

    @Autowired
    private AnonyUserService anonyUserService;

    @Autowired
    private PictureService pictureService;

    @Autowired
    private TopicHotDynamicCacheService topicHotDynamicCacheService;



    @ApiOperation("随机获取一个匿名用户")
    @GetMapping("/getOneAnonymous")
    public Result getOneAnonymous(){
        return anonyUserService.getOneAnonymous();
    }

    @ApiOperation("新增匿名信息")
    @PostMapping("/saveAnonymousUser")
    public Result saveAnonymousUser(@Validated AddAnonymousUserDTO addAnonymousUserDTO){
        //检查文件和文本内容是否违规
        return anonyUserService.saveAnonymousUser(addAnonymousUserDTO);
    }

    /**
     * 根据用户id查询匿名用户信息
     * @return
     */
//    @ApiOperation(value = "根据用户id查询匿名用户信息", notes = "根据用户id查询匿名用户信息")
//    @GetMapping("/getAnonyUserInfoList")
//    public Result getAnonyUserInfoList(@RequestParam Integer userId){
//        return anonyUserService.getAnonyUserInfo(userId);
//    }

    /**
     * 查询匿名昵称列表
     * @return
     */
//    @ApiOperation(value = "查询匿名昵称列表", notes = "查询匿名昵称列表")
//    @GetMapping("/getAnonyNameList")
//    public Result getAnonyNameList(){
//        return anonyUserService.getAnonyNameList();
//    }

    /**
     * 查询匿名头像列表
     * @return
     */
//    @ApiOperation(value = "查询匿名头像列表", notes = "查询匿名头像列表")
//    @GetMapping("/getAnonyAvatarList")
//    public Result getAnonyAvatarList(){
//        return anonyUserService.getAnonyAvatarList();
//    }




//    @ApiOperation(value = "修改用户匿名信息")
//    @PostMapping("/updateAnonyUserMessage")
//    public Result updateAnonyUserMessage(@RequestBody @Validated AnonyUserDTO anonyUserDTO){
//        return anonyUserService.updateAnonyUserMessage(anonyUserDTO);
//    }


}
